package com.cy.pj.brand.controller;

import com.cy.pj.brand.service.BrandService;
import com.cy.pj.brand.pojo.Brand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@org.springframework.stereotype.Controller
public class Controller {
    @Autowired
    private BrandService brandService;

    @RequestMapping("/brand/doFindBrands/{name}")
    public String doFindBrands(@PathVariable String name, Model model) {
        List<Brand> list = brandService.findBrands(name);
        model.addAttribute("list", list);
        return "modules/brand";
    }
  /* @RequestMapping("/brand/doDeleteBrands/{id}")
    public String doDeleteBrands(@PathVariable int id,Model model){
       int rows=brandService.deleteById(id);
       model.addAttribute("rows", rows);
       return "modules/brand";
   }
   @RequestMapping("/brand/doAddBrands")
    public String doAddBrands(){
       return "modules/addBrand";
   }*/

}
